package com.itheima.jobs;



import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;

import com.itheima.utils.DateUtils;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class ClearOrderSetting {

    @Reference
    OrderSettingService orderSettingService;



    public void clear() {
        Date thisMonth = DateUtils.getFirstDay4ThisMonth();
        String today = new SimpleDateFormat("yyyy-MM-dd").format(thisMonth);
        orderSettingService.delete(today);
    }
}
